<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Canvas</title>
    <style type="text/css">
        body {
            text-align: center;
            padding-top: 20px;
        }
        canvas {
            box-shadow: 0 0 10px #333;
            margin: 0 auto;
        }
    </style>
</head>
<body onload="draw()">
<canvas id="canvas" width="800" height="600">
    你的浏览器太 low 了，请更新~!
</canvas>

<script>
    function draw() {
        var canvas = document.getElementById("canvas");
        if (canvas.getContext) {
            var ctx = canvas.getContext('2d');

            /**
             * font-weight、font-style、font-size、font-family
             */

            var lingrad = ctx.createLinearGradient(100, 200, 500, 200);
            lingrad.addColorStop(0.5, '#CC6677');
            lingrad.addColorStop(1, '#000');

            ctx.font = "bold italic 100px arial";
            ctx.shadowColor = "orange";
            ctx.shadowBlur = 10;
            ctx.shadowOffsetX = 20;
            ctx.shadowOffsetY = 20;

            ctx.fillStyle = lingrad;
            ctx.fillText('Hello World...', 100, 200);
        }
    }
</script>
</body>
</html>
